﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl" %>
<%@ Import Namespace="OAclient.Common" %>
<div id="applylistmy" style="padding-top: 35px;">
    <div>
        <table border="0" width="100%" class="table_style" cellpadding="0" cellspacing="0">
            <thead>
                <tr>
                    <th class="th_middle">
                        申请时间
                    </th>
                    <th class="th_middle">
                        开始时间
                    </th>
                    <th class="th_middle">
                        结束时间
                    </th>
                    <th class="th_short">
                        申请结果
                    </th>
                    <th>
                    </th>
                </tr>
            </thead>
            <tbody>
                <%
                    System.Data.DataTable dt = ViewData["dt"] as System.Data.DataTable;
                    if (dt == null || dt.Rows.Count == 0)
                    {%>
                <tr>
                    <td colspan="0" style="text-align: center;">
                        当前无数据！
                    </td>
                </tr>
                <% }
                    else
                    {
                        for (int i = 0; i < dt.Rows.Count; i++)
                        {
                %>
                <tr>
                    <td>
                        <%=dt.Rows[i]["申请时间"].ToString()%>
                    </td>
                    <td>
                        <%=dt.Rows[i]["开始时间"]%>
                    </td>
                    <td>
                        <%=dt.Rows[i]["结束时间"].ToString() %>
                    </td>
                    <td>
                        <% if (dt.Rows[i]["申请结果"].ToString() == "1")
                           {%>同意<%}%>
                        <% if (dt.Rows[i]["申请结果"].ToString() == "-1")
                           {%>未处理<%}%>
                        <% if (dt.Rows[i]["申请结果"].ToString() == "0")
                           {%>驳回<%}%>
                    </td>
                    <td>
                        <a class="btn_detail" onclick="showApplyDetail('<%=dt.Rows[i]["申请编码"]%>')">详细</a>
                    </td>
                </tr>
                <%
                    }
                    } %>
            </tbody>
        </table>
    </div>
    <div id="pageLink">
        <%var pageInfo = ViewData["pageInfo"] as PagingInfo; %>
        <%if (pageInfo != null)
          {  %>
        <%=Ajax.PageLinks(pageInfo, index => Url.Action("ApplyListMy",new
                {
                    page = index,
                }), new AjaxOptions { UpdateTargetId = "apply-2" })%>
        <%} %>
    </div>
</div>

<script type="text/javascript">
    function showApplyDetail(apply_id) {
        $.ajax({
            type: "POST",
            url: "/Car/ApplyDetial",
            data: { "apply_id": apply_id },
            success: function(data) {
                addtab('apply-3', '申请内容');
                $("#workarea-apply-3").html(data);
            }
        })
    }
</script>

